﻿
@{
    ViewBag.Title = Resources.WebStringsWeb.WebTitle;
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}
@section css {
    <link href="~/Assets/css/lib/bootstrap-select.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/bootstrap-datetimepicker.min.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/fileinput.css" rel="stylesheet" />
    <style>
        th {
            text-align: center;
            font-weight: bold;
        }

        td {
            text-align: center;
            vertical-align: middle;
        }

        .center {
            position: fixed;
            top: 50%;
            left: 50%;
            background-color: #000;
            width: 600px;
            -webkit-transform: translateX(-50%) translateY(-50%);
            -moz-transform: translateX(-50%) translateY(-50%);
            -ms-transform: translateX(-50%) translateY(-50%);
            transform: translateX(-50%) translateY(-50%);
            border-radius: 3px;
        }

        .removeImage {
            position: relative;
            right: -55px;
            top: -12px;
            float: left;
            font-weight: bold;
            color: red;
        }
    </style>
}
<div class="page-content" ng-cloak ng-controller="CheckFormController" ng-init="
     page = '@(Request.QueryString["page"].IsEmpty() ? "1" : Request.QueryString["page"])';
     PageName='@(Request.QueryString["PageName"].IsEmpty() ? "" : Request.QueryString["PageName"])';
     Id ='@(Request.QueryString["Id"].IsEmpty() ? "" : Request.QueryString["Id"])';
     GetSuperviseCheckType();
     AddModel={};
     AddModel.FeedBackFormNo = 'S'+'@DateTime.Now.ToString("yyMMddHHmmssfff")';
     CheckItems=[];
     ImageCount = [0,1,2,3,4];
     SearchModel={};
     SearchModel.StartTime='@DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd")';
     SearchModel.EndTime='@DateTime.Now.ToString("yyyy-MM-dd")';
     GetSupervisionInspectionAllList(SearchModel);
     ">
    <div class="load" ng-show="DataLoading">
        <div class="loader">
            <svg version="1.1" id="loader-1" x="0px" y="0px" width="100px" height="100px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
            <path fill="#000" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
            <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite" />

			</path>
		</svg>
            <div class="load-msg" ng-bind="LoadingMsg"></div>
        </div>
    </div>
    <div class="load" id="previewimg" ng-show="IsPreview" ng-click="ClosePreview();">
        <img id="imgshow" class="center" />
    </div>
    <div class="page-heading">
        <h1>检查编辑</h1>
        <div class="options">
            <div class="btn-toolbar">

            </div>
        </div>
    </div>
    <ol class="breadcrumb">
        <li><a>主体业务</a></li>
        <li><a>安全检查</a></li>
        <li><a>监督检查</a></li>
        <li class="active"><a>添加监督检查反馈单</a></li>
    </ol>

    <div class="container-fluid">
        <div class="row">
            <form class="form-horizontal row-border">
                <div class="col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading"><h2>关联监督检查单</h2></div>
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-lg-12">
                                    <div class="form-group">
                                        <label class="col-sm-1 control-label">类型：</label>
                                        <div class="col-sm-2">
                                            <select class="form-control" ng-model="SearchModel.CheckType" ng-change="GetSupervisionInspectionAllList(SearchModel);">
                                                <option value="">所有类型</option>
                                                <option ng-repeat="x in CheckTypeList" value="{{x.Id}}">{{x.IntervalName}}</option>
                                            </select>
                                        </div>
                                        <label class="col-sm-1 control-label">检查时间：</label>
                                        <div class="col-lg-2">
                                            <datepicker id="startTime" option="datetimeOption" format="L" ng-model="SearchModel.StartTime"></datepicker>
                                        </div>
                                        <div class="col-lg-2">
                                            <datepicker id="startTime" option="datetimeOption" format="L" ng-model="SearchModel.EndTime"></datepicker>
                                        </div>
                                        <div class="col-sm-1"><button type="button" ng-click="GetSupervisionInspectionAllList(SearchModel,1);" class="btn btn-primary">查询</button></div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12">
                                    <table class="table table-striped table-bordered table-hover" ng-show="!PageLoading">
                                        <thead>
                                            <tr>
                                                <th><a ng-click="SelectAllRecord('.chk_id');">全选</a> / <a ng-click="CancelAllRecord('.chk_id');">取消全选</a></th>
                                                <th>序号</th>
                                                <th>场所</th>
                                                <th>检查单号</th>
                                                <th>检查日期</th>
                                                <th>类型</th>
                                                <th>部门</th>
                                                <th>登记人</th>
                                                <th>检查情况</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr ng-show="CheckFormPageList.length==0 && !PageLoading">
                                                <td colspan="12" style="text-align:center;vertical-align:middle;line-height:30px;">没有数据</td>
                                            </tr>
                                            <tr ng-repeat="x in CheckFormPageList">
                                                <td>
                                                    <input type="checkbox" class="chk_id" id="{{x.FormId}}" />
                                                </td>
                                                <td>
                                                    <span ng-bind="$index+1"></span>
                                                </td>
                                                <td>{{x.PlaceName}}</td>
                                                <td ng-bind="x.FormNo"></td>

                                                <td>{{x.CheckTime|JSONDate:'yyyy-MM-dd'}}</td>
                                                <td>{{x.CheckTypeName}}</td>
                                                <td ng-bind="x.DepartmentName"></td>
                                                <td ng-bind="x.CreateUserName"></td>
                                                <td><span ng-show="!x.IsException" class="badge badge-success">正常</span><span ng-show="x.IsException" class="badge badge-danger">异常</span></td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <div class="panel-footer">
                            <div class="col-md-1">
                                <button class="btn-primary btn" ng-click="CreateFeedbackDetail(AddModel);">生成反馈单</button>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
        <div class="row">
            <form class="form-horizontal row-border">
                <div class="col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading"><h2>添加监督检查反馈单</h2></div>
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><b style="color:red;"></b>被检查部门：</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" ng-model="AddModel.CheckedDepartment" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><b style="color:red;"></b>园区：</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" ng-model="AddModel.ParkName" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><b style="color:red;"></b>地点：</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" ng-model="AddModel.CheckPlace" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><b style="color:red;"></b>检查类型：</label>
                                <div class="col-sm-8">
                                    <select class="form-control" ng-model="AddModel.CheckType">
                                        <option ng-repeat="x in CheckTypeList" value="{{x.Id}}">{{x.IntervalName}}</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><b style="color:red;"></b>检查时间：</label>
                                <div class="col-sm-8">
                                    <datepicker id="startTime" option="datetimeOption" format="L" ng-model="AddModel.CheckTime"></datepicker>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><b style="color:red;"></b>监督检查人员：</label>
                                <div class="col-sm-8">
                                    <textarea type="text" class="form-control" rows="4" ng-model="AddModel.CheckUser"></textarea>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label"><b style="color:red;"></b>安全生产监督检查主要内容：</label>
                                <div class="col-sm-8">
                                    <textarea type="text" class="form-control" rows="4" ng-model="AddModel.CheckContent"></textarea>
                                </div>

                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><b style="color:red;"></b>存在问题及处理意见(建议)：</label>
                                <div class="col-sm-8">
                                    <textarea type="text" class="form-control" rows="4" ng-model="AddModel.Advice"></textarea>
                                </div>

                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><b style="color:red;"></b>被检查单位确认人：</label>
                                <div class="col-sm-8">
                                    <textarea type="text" class="form-control" rows="4" ng-model="AddModel.CheckedPerson"></textarea>
                                </div>

                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><b style="color:red;"></b>被检查单位对问题处置情况：</label>
                                <div class="col-sm-8">
                                    <textarea type="text" class="form-control" rows="4" ng-model="AddModel.DisposalProcess"></textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">上传照片<span class="not-null"></span></label>
                                <div class="col-lg-8">
                                    <input type="file" ngf-select ng-model="doc.Files" name="docfiles" id="docfiles" class="file" initialPreviewAsData="true" data-show-remove="true" data-show-preview="true" showCancel="false" data-show-upload="false" accept="image/*" multiple>
                                </div>
                            </div>
                        </div>
                        <div class="panel-footer">
                            <div class="col-md-4">
                            </div>
                            <div class="col-md-1">
                                <button class="btn-primary btn" ng-click="CheckFeedbackFormAdd(AddModel);">提交</button>
                            </div>
                            <div class="col-md-1">
                                <a href="CheckFeedbackPageList?page={{page}}" class="btn-default btn">返回</a>
                            </div>
                            <div class="col-md-3">
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>

    </div>

</div>


@section Js{
    <script src="~/Assets/js/libs/upload.js"></script>
    <script src="~/Assets/js/pg/CheckForm.js?v=@DateTime.Now.ToString("yyMMddHHmm")"></script>
    <script src="~/Assets/js/libs/moment.min.js"></script>
    <script src="~/Assets/js/libs/locales/date/zh-cn.js"></script>
    <script src="~/Assets/js/libs/bootstrap-datetimepicker.min.js"></script>
    <script src="~/Assets/js/libs/angularjs-datepicker.js"></script>
    <script src="~/Assets/js/libs/fileinput.js"></script>
    <script src="~/Assets/js/libs/zh.js"></script>
    <script>
        $('#docfiles').fileinput({
            language: 'zh'
        });
        $(".selectpicker").selectpicker({

            noneSelectedText: '请选择'//默认显示内容

        });
    </script>
}
}
